package com.zyz.common.security.exception;

import com.zyz.common.core.enums.ResultCodeEnum;
import lombok.Getter;

@Getter
public class ServiceException extends RuntimeException{
    private final Integer code;
    private final String message;

    public ServiceException(String message) {
        this.code = 500;
        this.message = message;
    }

    public ServiceException(ResultCodeEnum resultCodeEnum) {
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMsg();
    }

}
